package ipdesk.interceptor;

import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsStatics;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class ClearCacheInterceptor  extends AbstractInterceptor
{    
	public String intercept(ActionInvocation invocation) throws Exception 
	{        
		ActionContext context=(ActionContext)invocation.getInvocationContext();
		HttpServletResponse response=(HttpServletResponse)context.get(StrutsStatics.HTTP_RESPONSE);
		response.setHeader("Cache-Control", "no-cache,no-store");
		response.setHeader("Pragma", "no-cache");
		response.setHeader("Expires", "-1");
		String result=invocation.invoke();
		return result;
	}
}
